<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<script src="vue.js"></script>
	<body>
		<div id="app">
			<img :src="image" id="img" >
			<button @click="click" type="button">点我切换图片</button>
		</div>
	</body>
	<script>
		var app = new Vue({
			el:"#app",
			data:{
				image:'./img1.png',
			},
			methods:{
				click(){
					if(this.image=="./img1.png")
					{
						this.image="./img2.png";
						console.log("111")
					}else{
						this.image="./img1.png";
						console.log("22222")
					}
							
				},
				
			},
		});
			
	</script>
</html>
